package demo3;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class Person {
    /*
        当一个类中需要使用另一个类时,Spring要求我们将该类作为属性定义在当前类中
    */
    @Autowired
    @Qualifier("winter")
    //private Shirt shirt;
    //private Sweater sweater;
    private  Clothes clothes;

    @Override
    public String toString() {
        return "Person{" +
                "Clothes=" + clothes +
                '}';
    }
}
